import java.util.Iterator;
import java.util.List;

public class Tools {
    public static List toShow(List<Student> list){
        list.forEach(student -> {
            System.out.println(student);
        });
        return list;
    }
    public static double sAvg(List<Student> list){
        Iterator<Student> iterator=list.iterator();
        double sum=0.0;
        while (iterator.hasNext()){
            sum+=iterator.next().getsJava();
        }
        return sum/list.size();
    }
    public static double sMax(List<Student> list){
        Iterator<Student> iterator=list.iterator();
        double max=iterator.next().getsJava();
        while (iterator.hasNext()){
            Student s=iterator.next();
            if (s.getsJava()>max){
                max=s.getsJava();
            }
        }
        return max;
    }
    public static double sMin(List<Student> list){
        Iterator<Student> iterator=list.iterator();
        double min=iterator.next().getsJava();
        while (iterator.hasNext()){
            Student s=iterator.next();
            if (s.getsJava()<min){
                min=s.getsJava();
            }
        }
        return min;
    }
}
